﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class Client_UserControl_ucBanner : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            try
            {
                LoadXMLAdvertise();
            }
            catch (Exception)
            {
            }
        }
    }

    private void LoadXMLAdvertise()
    {
        try
        {
            string strAdvertiseXMLFielPath = Server.MapPath(Global.ADVERTISE_XML_FILE_URL);
            DataSet ds = new DataSet();
            ds.ReadXml(strAdvertiseXMLFielPath);
            if (ds.Tables.Count > 0)
            {
                DataTable dt = ds.Tables[0];
                if (dt.Rows.Count > 0)
                {
                    rptAdvertise.DataSource = dt;
                    rptAdvertise.DataBind();
                }
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }

}
